from Episode import Episode

class EpisodeUtil(object):
            
    def createFromMatch(self, match):
        episodeNumber = match.group(3)
        extraEpisodeNumber =  match.group(4)
        container = match.group(5)
        return Episode(Episode.DEFAULT_EPS_NAME, episodeNumber, container, extraEpisodeNumber)
    
    
    def loadFromXml(self, episode, xml):
        episode.title = xml.findtext("EpisodeName")
        episode.rating = xml.findtext("Rating")
        episode.director = xml.findtext("Director")
        episode.plot = xml.findtext("Overview")
        episode.aired = xml.findtext("FirstAired")
        return episode
        
                